--- /dev/null
+
+#
+# DeLorme .an1 tests
+#
+rm -f ${TMPDIR}/an1.out
+gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o csv -F ${TMPDIR}/an1.out
+compare ${REFERENCE}/an1-in.ref ${TMPDIR}/an1.out
+
+rm -f ${TMPDIR}/an1.out
+gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o an1 -F ${TMPDIR}/an1.out
+bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-an1.ref
+
+rm -f ${TMPDIR}/an1.out
+gpsbabel -i xmap -f ${REFERENCE}/xmap -o an1 -F ${TMPDIR}/an1.out
+bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-out.ref
+
+rm -f ${TMPDIR}/an1.out
+gpsbabel -i google -f ${REFERENCE}/google.js -o an1 -F ${TMPDIR}/an1.out
+bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-line-out.ref
+
--- /dev/null
+#
+# Map&Guide Motorrad Routenplaner .bcr files test
+#
+rm -f ${TMPDIR}/bcr*
+gpsbabel -r -i bcr -f ${REFERENCE}/route/bcr-sample.bcr -o gpx -F ${TMPDIR}/bcr-sample.gpx
+compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample.gpx
+gpsbabel -r -i gpx -f ${REFERENCE}/route/bcr-sample.gpx -o bcr -F ${TMPDIR}/bcr-sample2.bcr
+compare ${REFERENCE}/route/bcr-sample2.bcr ${TMPDIR}/bcr-sample2.bcr
+gpsbabel -r -i bcr -f ${TMPDIR}/bcr-sample2.bcr -o gpx -F ${TMPDIR}/bcr-sample2.gpx
+compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample2.gpx
+
# Magellan serial
# TODO
-# TPG (NG Topo!) file format
-# This is hard to test as the datum conversions create minute
-# inconsistencies in the coordinates. So.. we test our i/o
-# against a format that rounds higher than we care to compare
-# for binary data.
-rm -f ${TMPDIR}/topo.mxf ${TMPDIR}/tpg.mxf ${TMPDIR}/geo.tpg
-gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o tpg -F ${TMPDIR}/geo.tpg
-gpsbabel -i tpg -f ${TMPDIR}/geo.tpg -o mxf -F ${TMPDIR}/tpg.mxf
-gpsbabel -i tpg -f ${REFERENCE}/tpg.tpg -o mxf -F ${TMPDIR}/topo.mxf
-compare ${TMPDIR}/tpg.mxf ${TMPDIR}/topo.mxf
-
-# Holux support is a little funky to test. Becuase it loses precision,
-# if we convert it to another format, we lose accuracy (rounding) in the
-# coords, so converting it so something else and comparing it never works.
-# So we verify that we can read the reference and write it and get an
-# identical reference.
-gpsbabel -i holux -f ${REFERENCE}/paris.wpo -o holux -F ${TMPDIR}/paris.wpo
-# compare ${REFERENCE}/paris.wpo ${TMPDIR}/paris.wpo
-
-# GPSPilot Tracker for PalmOS
-# This test is eerily similar to the NAV Companion test. In fact, the
-# converted reference file (magnavr.gpu) is identical.
-rm -f ${TMPDIR}/gpspilot.pdb ${TMPDIR}/gpspilot.gpu ${TMPDIR}/gpspil_t.gpu
-gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o gpspilot -F ${TMPDIR}/gpspilot.pdb
-gpsbabel -i gpspilot -f ${TMPDIR}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspilot.gpu
-gpsbabel -i gpspilot -f ${REFERENCE}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspil_t.gpu
-compare ${TMPDIR}/gpspil_t.gpu ${TMPDIR}/gpspilot.gpu
-compare ${REFERENCE}/gu.wpt ${TMPDIR}/gpspilot.gpu
-
-# XMapHH Street Atlas USA file format
-rm -f ${TMPDIR}/xmapwpt.wpt ${TMPDIR}/xmapwpt.xmapwpt
-gpsbabel -i xmapwpt -f ${REFERENCE}/xmapwpt.wpt -o xmapwpt -F ${TMPDIR}/xmapwpt.xmapwpt
-gpsbabel -i xmapwpt -f ${TMPDIR}/xmapwpt.xmapwpt -o xmapwpt -F ${TMPDIR}/xmapwpt.wpt
-compare ${TMPDIR}/xmapwpt.wpt ${REFERENCE}
-
-# Garmin Mapsource This is a binary format with some undocumented
-# fields. This test is therefore intentionally vague. We read a file,
-# convert it to GPX, then write a file as MPS, then read it back and
-# write it as GPX and compare them. Since we're writing both GPX files
-# ourselves from the same version, we're immune to changes in our own
-# GPX output.
-
-rm -fr ${TMPDIR}/ms.gpx ${TMPDIR}/ms[12].gpx
-gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o gpx -F ${TMPDIR}/ms1.gpx
-gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o mapsource -F ${TMPDIR}/ms.mps
-gpsbabel -i mapsource -f ${TMPDIR}/ms.mps -o gpx -F ${TMPDIR}/ms2.gpx
-compare ${TMPDIR}/ms1.gpx ${TMPDIR}/ms2.gpx
-
-#
-# MRCB mapsource track test
-#
-rm -f ${TMPDIR}/mps-track.mps
-gpsbabel -t -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \
- -F ${TMPDIR}/mps-track.mps
-compare ${TMPDIR}/mps-track.mps ${REFERENCE}/track
-
-# Now do a test of reading waypoints from a track-only file - should have an empty result
-rm -f ${TMPDIR}/mps-track.mps
-gpsbabel -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \
- -F ${TMPDIR}/mps-track.mps
-compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-track.mps
-
-#
-# MRCB mapsource route test
-#
-rm -f ${TMPDIR}/mps-route.mps
-gpsbabel -r -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=4 \
- -F ${TMPDIR}/mps-route.mps
-compare ${REFERENCE}/route/route.mps ${TMPDIR}/mps-route.mps
-
-# Now do a test of reading tracks from a route-only file - should have an empty result
-rm -f ${TMPDIR}/mps-route.mps
-gpsbabel -t -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=3 \
- -F ${TMPDIR}/mps-route.mps
-compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-route.mps
-#
-# magellan SD card waypoint / route format
-#
-rm -f ${TMPDIR}/magellan.rte
-gpsbabel -r -i magellan -f ${REFERENCE}/route/magellan.rte -o magellan \
- -F ${TMPDIR}/magellan.rte
-compare ${REFERENCE}/route/magellan.rte ${TMPDIR}/magellan.rte
-
#
# GPX routes -- since GPX contains a date stamp, tests will always
-F ${TMPDIR}/maggpx.trk
compare ${TMPDIR}/maggpx.trk ${TMPDIR}/gpxtrack.gpx
-#
-# MAPSEND waypoint / route format
-#
-rm -f ${TMPDIR}/route.mapsend
-gpsbabel -r -i mapsend -f ${REFERENCE}/route/route.mapsend -o mapsend \
- -F ${TMPDIR}/route.mapsend
-bincompare ${TMPDIR}/route.mapsend ${REFERENCE}/route/route.mapsend
-
-#
-# MAPSEND track format
-#
-rm -f ${TMPDIR}/mapsend.trk
-gpsbabel -t -i mapsend -f ${REFERENCE}/track/mapsend.trk -o mapsend,trkver=3 \
- -F ${TMPDIR}/mapsend.trk
-compare ${TMPDIR}/mapsend.trk ${REFERENCE}/track/
-
#!/bin/sh
-#
-# Route reversal filter. Do it twice and be sure we get what we
-# started with.
-#
-rm -f ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc ${TMPDIR}/reference.arc
-gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \
- -o arc -F ${TMPDIR}/reference.arc
-gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \
- -x reverse \
- -o arc -F ${TMPDIR}/reverse1.arc
-gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \
- -x reverse \
- -x reverse \
- -o arc -F ${TMPDIR}/reverse2.arc
-# Verify the first and last are the same
-compare ${TMPDIR}/reference.arc ${TMPDIR}/reverse2.arc
-# Verify the first and second are different.
-#${DIFF} ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc > /dev/null && {
-# echo ERROR Failed reversal test.
-# exit 1
-#}
-
-# parkrrrr: This isn't a straightforward compare; we *want* it to fail.
-# Obviously this test should just be rewritten with a new reference.
-#compare ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc
-
-
-#
-# DeLorme .an1 tests
-#
-rm -f ${TMPDIR}/an1.out
-gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o csv -F ${TMPDIR}/an1.out
-compare ${REFERENCE}/an1-in.ref ${TMPDIR}/an1.out
-
-rm -f ${TMPDIR}/an1.out
-gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o an1 -F ${TMPDIR}/an1.out
-bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-an1.ref
-
-rm -f ${TMPDIR}/an1.out
-gpsbabel -i xmap -f ${REFERENCE}/xmap -o an1 -F ${TMPDIR}/an1.out
-bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-out.ref
-
-rm -f ${TMPDIR}/an1.out
-gpsbabel -i google -f ${REFERENCE}/google.js -o an1 -F ${TMPDIR}/an1.out
-bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-line-out.ref
-
#
# XCSV "human readable" tests
gpsbabel -i magellan -f ${REFERENCE}/dusky.trk -o xcsv,style=${REFERENCE}/gnuplot.style -F ${TMPDIR}/pathdist.out
compare ${REFERENCE}/dusky.gnuplot ${TMPDIR}/pathdist.out
-# hsandv
-rm -f ${TMPDIR}/hsandv.exp ${TMPDIR}/1.exp ${TMPDIR}/1.exp ${TMPDIR}/Glad_5.exp
-gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o hsandv -F ${TMPDIR}/hsandv.exp
-compare ${TMPDIR}/hsandv.exp ${REFERENCE}
-#the hsandv format is too lossy to do this test :(
-#gpsbabel -i hsandv -f ${TMPDIR}/hsandv.exp -o geo -F ${TMPDIR}/1.exp
-#gpsbabel -i hsandv -f ${REFERENCE}/hsandv.exp -o geo -F ${TMPDIR}/2.exp
-#compare ${TMPDIR}/1.exp ${TMPDIR}/2.exp
-#test conversion from v4 to v5 files
-gpsbabel -i hsandv -f ${REFERENCE}/Glad_4.exp -o hsandv -F ${TMPDIR}/Glad_5.exp
-# FIXME: Can't compare directly because of potential FP rounding.
-# FIXME: compare ${TMPDIR}/Glad_5.exp reference
-
-#
-# stack filter tests
-# These don't actually test for proper behavior, for now, but they do
-# exercise all of the currently-extant filter code.
-#
-
-gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F ${TMPDIR}/stackfilt.txt
-
#
# 'tabsep' isn't really tested in any non-trivial way, but we do exercise
# it.
#
gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o text -F ${TMPDIR}/text.out -o html -F ${TMPDIR}/html.out -o vcard -F ${TMPDIR}/vcard.out #-o palmdoc -F ${TMPDIR}/pd.out
-#
-# Map&Guide Motorrad Routenplaner .bcr files test
-#
-rm -f ${TMPDIR}/bcr*
-gpsbabel -r -i bcr -f ${REFERENCE}/route/bcr-sample.bcr -o gpx -F ${TMPDIR}/bcr-sample.gpx
-compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample.gpx
-gpsbabel -r -i gpx -f ${REFERENCE}/route/bcr-sample.gpx -o bcr -F ${TMPDIR}/bcr-sample2.bcr
-compare ${REFERENCE}/route/bcr-sample2.bcr ${TMPDIR}/bcr-sample2.bcr
-gpsbabel -r -i bcr -f ${TMPDIR}/bcr-sample2.bcr -o gpx -F ${TMPDIR}/bcr-sample2.gpx
-compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample2.gpx
-
gpsbabel -i ignrando -f ${REFERENCE}/track/ignrando-sample.rdn -o ignrando -F ${TMPDIR}/ignrando-sample.rdn
gpsbabel -i ignrando -f ${TMPDIR}/ignrando-sample.rdn -o gpx -F ${TMPDIR}/ignrando-sample.gpx
compare ${REFERENCE}/track/ignrando-sample.gpx ${TMPDIR}/ignrando-sample.gpx
-#
-# Microsoft AutoRoute 2002 test (read-only)
-#
-gpsbabel -i msroute -f ${REFERENCE}/route/msroute-sample.axe -o gpx -F ${TMPDIR}/msroute-sample.gpx
-compare ${REFERENCE}/route/msroute-sample.gpx ${TMPDIR}/msroute-sample.gpx
-
#
# Testing the 'nuketypes' filter is funky.
grep -v time <${TMPDIR}/wbt-201.gpx >${TMPDIR}/wbt-201.gpx2
compare ${REFERENCE}/wbt-201.gpx ${TMPDIR}/wbt-201.gpx2
-
-#
-# Suunto SDF
-#
-rm -f ${TMPDIR}/stmsdf*
-gpsbabel -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -t -o stmsdf -F ${TMPDIR}/stmsdf-track.sdf -r -o stmsdf,index=2 -F ${TMPDIR}/stmsdf-route.sdf
-compare ${REFERENCE}/track/stmsdf-track.sdf ${TMPDIR}/stmsdf-track.sdf
-compare ${REFERENCE}/route/stmsdf-route.sdf ${TMPDIR}/stmsdf-route.sdf
-gpsbabel -i stmsdf -f ${TMPDIR}/stmsdf-track.sdf -f ${TMPDIR}/stmsdf-route.sdf -o garmin_txt,prec=2 -F ${TMPDIR}/stmsdf.txt
-compare ${REFERENCE}/stmsdf.txt ${TMPDIR}/stmsdf.txt
-
-#
-# Digital Mapping Tracklogs
-#
-rm -f ${TMPDIR}/dmtlog*
-gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -o dmtlog -F ${TMPDIR}/dmtlog-sample.trl
-gpsbabel -i dmtlog -f ${TMPDIR}/dmtlog-sample.trl -o gpx -F ${TMPDIR}/dmtlog-sample.gpx
-compare ${REFERENCE}/track/dmtlog-sample.gpx ${TMPDIR}/dmtlog-sample.gpx
-
#
# gzipped file i/o
#
gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -x nuketypes,routes,tracks -x transform,rte=wpt,del=y -o gpx -F ${TMPDIR}/transform-ver.gpx
compare ${REFERENCE}/transform-rte.gpx ${TMPDIR}/transform-ver.gpx
-#
-# VITO SmartMap .vtt track file 'vitovtt' test
-#
-rm -f ${TMPDIR}/vitovtt-*
-gpsbabel -i vitovtt -f ${REFERENCE}/track/vitovtt-sample.vtt -o gpx -F ${TMPDIR}/vitovtt-sample.gpx
-compare ${REFERENCE}/track/vitovtt-sample.gpx ${TMPDIR}/vitovtt-sample.gpx
-
-#!/bin/sh
-#
-# unicsv with various grids
-#
-gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-swiss.csv -o gpx -F ${TMPDIR}/grid-swiss~csv.gpx
-compare ${REFERENCE}/grid-swiss~csv.gpx ${TMPDIR}/grid-swiss~csv.gpx
-gpsbabel -i gpx -f ${REFERENCE}/grid-swiss~csv.gpx -o unicsv,utc=0,grid=swiss -F ${TMPDIR}/grid-swiss.csv
-compare ${REFERENCE}/grid-swiss.csv ${TMPDIR}/grid-swiss.csv
-
-gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-bng.csv -o gpx -F ${TMPDIR}/grid-bng~csv.gpx
-compare ${REFERENCE}/grid-bng~csv.gpx ${TMPDIR}/grid-bng~csv.gpx
-gpsbabel -i gpx -f ${REFERENCE}/grid-bng~csv.gpx -o unicsv,utc=0,grid=bng -F ${TMPDIR}/grid-bng.csv
-compare ${REFERENCE}/grid-bng.csv ${TMPDIR}/grid-bng.csv
-
-gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-utm.csv -o gpx -F ${TMPDIR}/grid-utm~csv.gpx
-compare ${REFERENCE}/grid-utm~csv.gpx ${TMPDIR}/grid-utm~csv.gpx
-gpsbabel -i gpx -f ${REFERENCE}/grid-utm~csv.gpx -o unicsv,utc=0,grid=utm -F ${TMPDIR}/grid-utm.csv
-compare ${REFERENCE}/grid-utm.csv ${TMPDIR}/grid-utm.csv
-
-#
-# MGL Enigma route file (.ert)
-#
-gpsbabel -i gpx -f ${REFERENCE}/enigma.gpx -o enigma -F ${TMPDIR}/enigma.ert
-compare ${REFERENCE}/enigma-gpsb.ert ${TMPDIR}/enigma.ert
-gpsbabel -i enigma -f ${REFERENCE}/enigma-pfms.ert -o gpx -F ${TMPDIR}/enigma.gpx
-compare ${REFERENCE}/enigma.gpx ${TMPDIR}/enigma.gpx
--- /dev/null
+#
+# Digital Mapping Tracklogs
+#
+rm -f ${TMPDIR}/dmtlog*
+gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -o dmtlog -F ${TMPDIR}/dmtlog-sample.trl
+gpsbabel -i dmtlog -f ${TMPDIR}/dmtlog-sample.trl -o gpx -F ${TMPDIR}/dmtlog-sample.gpx
+compare ${REFERENCE}/track/dmtlog-sample.gpx ${TMPDIR}/dmtlog-sample.gpx
+
--- /dev/null
+
+#
+# MGL Enigma route file (.ert)
+#
+gpsbabel -i gpx -f ${REFERENCE}/enigma.gpx -o enigma -F ${TMPDIR}/enigma.ert
+compare ${REFERENCE}/enigma-gpsb.ert ${TMPDIR}/enigma.ert
+gpsbabel -i enigma -f ${REFERENCE}/enigma-pfms.ert -o gpx -F ${TMPDIR}/enigma.gpx
+compare ${REFERENCE}/enigma.gpx ${TMPDIR}/enigma.gpx
--- /dev/null
+# GPSPilot Tracker for PalmOS
+# This test is eerily similar to the NAV Companion test. In fact, the
+# converted reference file (magnavr.gpu) is identical.
+rm -f ${TMPDIR}/gpspilot.pdb ${TMPDIR}/gpspilot.gpu ${TMPDIR}/gpspil_t.gpu
+gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o gpspilot -F ${TMPDIR}/gpspilot.pdb
+gpsbabel -i gpspilot -f ${TMPDIR}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspilot.gpu
+gpsbabel -i gpspilot -f ${REFERENCE}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspil_t.gpu
+compare ${TMPDIR}/gpspil_t.gpu ${TMPDIR}/gpspilot.gpu
+compare ${REFERENCE}/gu.wpt ${TMPDIR}/gpspilot.gpu
--- /dev/null
+
+# Holux support is a little funky to test. Becuase it loses precision,
+# if we convert it to another format, we lose accuracy (rounding) in the
+# coords, so converting it so something else and comparing it never works.
+# So we verify that we can read the reference and write it and get an
+# identical reference.
+gpsbabel -i holux -f ${REFERENCE}/paris.wpo -o holux -F ${TMPDIR}/paris.wpo
+# compare ${REFERENCE}/paris.wpo ${TMPDIR}/paris.wpo
--- /dev/null
+# hsandv
+rm -f ${TMPDIR}/hsandv.exp ${TMPDIR}/1.exp ${TMPDIR}/1.exp ${TMPDIR}/Glad_5.exp
+gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o hsandv -F ${TMPDIR}/hsandv.exp
+compare ${TMPDIR}/hsandv.exp ${REFERENCE}
+#the hsandv format is too lossy to do this test :(
+#gpsbabel -i hsandv -f ${TMPDIR}/hsandv.exp -o geo -F ${TMPDIR}/1.exp
+#gpsbabel -i hsandv -f ${REFERENCE}/hsandv.exp -o geo -F ${TMPDIR}/2.exp
+#compare ${TMPDIR}/1.exp ${TMPDIR}/2.exp
+#test conversion from v4 to v5 files
+gpsbabel -i hsandv -f ${REFERENCE}/Glad_4.exp -o hsandv -F ${TMPDIR}/Glad_5.exp
+# FIXME: Can't compare directly because of potential FP rounding.
+# FIXME: compare ${TMPDIR}/Glad_5.exp reference
--- /dev/null
+#
+# magellan SD card waypoint / route format
+#
+rm -f ${TMPDIR}/magellan.rte
+gpsbabel -r -i magellan -f ${REFERENCE}/route/magellan.rte -o magellan \
+ -F ${TMPDIR}/magellan.rte
+compare ${REFERENCE}/route/magellan.rte ${TMPDIR}/magellan.rte
+
gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o mapsend -F ${TMPDIR}/mm.mapsend
gpsbabel -i mapsend -f ${TMPDIR}/mm.mapsend -o gpsutil -F ${TMPDIR}/mm.gps
compare ${TMPDIR}/mm.gps ${TMPDIR}/gu.wpt
+
+#
+# MAPSEND waypoint / route format
+#
+rm -f ${TMPDIR}/route.mapsend
+gpsbabel -r -i mapsend -f ${REFERENCE}/route/route.mapsend -o mapsend \
+ -F ${TMPDIR}/route.mapsend
+bincompare ${TMPDIR}/route.mapsend ${REFERENCE}/route/route.mapsend
+
+#
+# MAPSEND track format
+#
+rm -f ${TMPDIR}/mapsend.trk
+gpsbabel -t -i mapsend -f ${REFERENCE}/track/mapsend.trk -o mapsend,trkver=3 \
+ -F ${TMPDIR}/mapsend.trk
+compare ${TMPDIR}/mapsend.trk ${REFERENCE}/track/
+
--- /dev/null
+
+# Garmin Mapsource This is a binary format with some undocumented
+# fields. This test is therefore intentionally vague. We read a file,
+# convert it to GPX, then write a file as MPS, then read it back and
+# write it as GPX and compare them. Since we're writing both GPX files
+# ourselves from the same version, we're immune to changes in our own
+# GPX output.
+
+rm -fr ${TMPDIR}/ms.gpx ${TMPDIR}/ms[12].gpx
+gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o gpx -F ${TMPDIR}/ms1.gpx
+gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o mapsource -F ${TMPDIR}/ms.mps
+gpsbabel -i mapsource -f ${TMPDIR}/ms.mps -o gpx -F ${TMPDIR}/ms2.gpx
+compare ${TMPDIR}/ms1.gpx ${TMPDIR}/ms2.gpx
+
+#
+# MRCB mapsource track test
+#
+rm -f ${TMPDIR}/mps-track.mps
+gpsbabel -t -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \
+ -F ${TMPDIR}/mps-track.mps
+compare ${TMPDIR}/mps-track.mps ${REFERENCE}/track
+
+# Now do a test of reading waypoints from a track-only file - should have an empty result
+rm -f ${TMPDIR}/mps-track.mps
+gpsbabel -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \
+ -F ${TMPDIR}/mps-track.mps
+compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-track.mps
+
+#
+# MRCB mapsource route test
+#
+rm -f ${TMPDIR}/mps-route.mps
+gpsbabel -r -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=4 \
+ -F ${TMPDIR}/mps-route.mps
+compare ${REFERENCE}/route/route.mps ${TMPDIR}/mps-route.mps
+
+# Now do a test of reading tracks from a route-only file - should have an empty result
+rm -f ${TMPDIR}/mps-route.mps
+gpsbabel -t -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=3 \
+ -F ${TMPDIR}/mps-route.mps
+compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-route.mps
--- /dev/null
+#
+# Microsoft AutoRoute 2002 test (read-only)
+#
+gpsbabel -i msroute -f ${REFERENCE}/route/msroute-sample.axe -o gpx -F ${TMPDIR}/msroute-sample.gpx
+compare ${REFERENCE}/route/msroute-sample.gpx ${TMPDIR}/msroute-sample.gpx
+
--- /dev/null
+#
+# Route reversal filter. Do it twice and be sure we get what we
+# started with.
+#
+rm -f ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc ${TMPDIR}/reference.arc
+gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \
+ -o arc -F ${TMPDIR}/reference.arc
+gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \
+ -x reverse \
+ -o arc -F ${TMPDIR}/reverse1.arc
+gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \
+ -x reverse \
+ -x reverse \
+ -o arc -F ${TMPDIR}/reverse2.arc
+# Verify the first and last are the same
+compare ${TMPDIR}/reference.arc ${TMPDIR}/reverse2.arc
+# Verify the first and second are different.
+#${DIFF} ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc > /dev/null && {
+# echo ERROR Failed reversal test.
+# exit 1
+#}
+
+# parkrrrr: This isn't a straightforward compare; we *want* it to fail.
+# Obviously this test should just be rewritten with a new reference.
+#compare ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc
+
--- /dev/null
+
+#
+# stack filter tests
+# These don't actually test for proper behavior, for now, but they do
+# exercise all of the currently-extant filter code.
+#
+
+gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F ${TMPDIR}/stackfilt.txt
+
--- /dev/null
+
+#
+# Suunto SDF
+#
+rm -f ${TMPDIR}/stmsdf*
+gpsbabel -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -t -o stmsdf -F ${TMPDIR}/stmsdf-track.sdf -r -o stmsdf,index=2 -F ${TMPDIR}/stmsdf-route.sdf
+compare ${REFERENCE}/track/stmsdf-track.sdf ${TMPDIR}/stmsdf-track.sdf
+compare ${REFERENCE}/route/stmsdf-route.sdf ${TMPDIR}/stmsdf-route.sdf
+gpsbabel -i stmsdf -f ${TMPDIR}/stmsdf-track.sdf -f ${TMPDIR}/stmsdf-route.sdf -o garmin_txt,prec=2 -F ${TMPDIR}/stmsdf.txt
+compare ${REFERENCE}/stmsdf.txt ${TMPDIR}/stmsdf.txt
+
--- /dev/null
+
+# TPG (NG Topo!) file format
+# This is hard to test as the datum conversions create minute
+# inconsistencies in the coordinates. So.. we test our i/o
+# against a format that rounds higher than we care to compare
+# for binary data.
+rm -f ${TMPDIR}/topo.mxf ${TMPDIR}/tpg.mxf ${TMPDIR}/geo.tpg
+gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o tpg -F ${TMPDIR}/geo.tpg
+gpsbabel -i tpg -f ${TMPDIR}/geo.tpg -o mxf -F ${TMPDIR}/tpg.mxf
+gpsbabel -i tpg -f ${REFERENCE}/tpg.tpg -o mxf -F ${TMPDIR}/topo.mxf
+compare ${TMPDIR}/tpg.mxf ${TMPDIR}/topo.mxf
--- /dev/null
+#
+# unicsv with various grids
+#
+gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-swiss.csv -o gpx -F ${TMPDIR}/grid-swiss~csv.gpx
+compare ${REFERENCE}/grid-swiss~csv.gpx ${TMPDIR}/grid-swiss~csv.gpx
+gpsbabel -i gpx -f ${REFERENCE}/grid-swiss~csv.gpx -o unicsv,utc=0,grid=swiss -F ${TMPDIR}/grid-swiss.csv
+compare ${REFERENCE}/grid-swiss.csv ${TMPDIR}/grid-swiss.csv
+
+gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-bng.csv -o gpx -F ${TMPDIR}/grid-bng~csv.gpx
+compare ${REFERENCE}/grid-bng~csv.gpx ${TMPDIR}/grid-bng~csv.gpx
+gpsbabel -i gpx -f ${REFERENCE}/grid-bng~csv.gpx -o unicsv,utc=0,grid=bng -F ${TMPDIR}/grid-bng.csv
+compare ${REFERENCE}/grid-bng.csv ${TMPDIR}/grid-bng.csv
+
+gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-utm.csv -o gpx -F ${TMPDIR}/grid-utm~csv.gpx
+compare ${REFERENCE}/grid-utm~csv.gpx ${TMPDIR}/grid-utm~csv.gpx
+gpsbabel -i gpx -f ${REFERENCE}/grid-utm~csv.gpx -o unicsv,utc=0,grid=utm -F ${TMPDIR}/grid-utm.csv
+compare ${REFERENCE}/grid-utm.csv ${TMPDIR}/grid-utm.csv
--- /dev/null
+
+# XMapHH Street Atlas USA file format
+rm -f ${TMPDIR}/xmapwpt.wpt ${TMPDIR}/xmapwpt.xmapwpt
+gpsbabel -i xmapwpt -f ${REFERENCE}/xmapwpt.wpt -o xmapwpt -F ${TMPDIR}/xmapwpt.xmapwpt
+gpsbabel -i xmapwpt -f ${TMPDIR}/xmapwpt.xmapwpt -o xmapwpt -F ${TMPDIR}/xmapwpt.wpt
+compare ${TMPDIR}/xmapwpt.wpt ${REFERENCE}